<!-- 继承自模板：app_doc/docs_base.html -->
{% extends 'app_doc/docs_base.html' %}
<!-- 引入静态文件 -->
{% load static %}
{% load i18n %}
{% load doc_filter %}

{% block title %}{% trans "搜索" %} {{kw}} {% trans "的结果" %} - {{ project.name }}{% endblock %}

{% block head_toolbar %}
    {% if request.user == project.create_user %}
        <a class="btn pull-left" aria-label="" href="{% url 'create_doc' %}?pid={{project.id}}" target="_blank">
            <i class="fa fa-edit"></i> {% trans "添加文档" %}
        </a>
    {% endif %}
{% endblock %}

{% block content_head %}
    <h1>{% trans "搜索" %} {{kw}} {% trans "共有" %}{{ search_result.count }}{% trans "个结果" %}</h1><hr>
{% endblock %}

{% block page_content %}
    {% for result in search_result %}
        <div>
            <p><a href="{% url 'doc_id' doc_id=result.id %}?highlight={{kw}}" target="_blank">{{ result.name }}</a> - <span style="font-size: 14px;color: #999;">{{result.modify_time}}</span></p>
            <p>{{ result|remove_doc_tag }}</p>
        </div>
        <hr>
    {% endfor %}
{% endblock %}

{% block custom_script %}
<script>
    setTimeout(function(){
        keyLight('doc-content','{{kw}}')
    },500)
</script>
{% endblock %}